/*
 * @Author: SimonCK666 SimonYang223@163.com
 * @Date: 2022-05-07 20:18:32
 * @LastEditors: SimonCK666 SimonYang223@163.com
 * @LastEditTime: 2022-05-07 20:22:49
 * @FilePath: \golang-concept\L4_gofunc\param.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package main

import (
	"fmt"
)

func sum_param(a int, b int) int {
	sum := a + b
	return sum
}

// 传递可变参数
func f1(args ...int) {
	for _, v := range args {
		fmt.Printf("v: %v\n", v)
	}
}

func para_opt() {
	sum := sum_param(1, 2)
	fmt.Printf("sum: %v\n", sum)

	f1(1, 2, 3, 4)
}
